﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using RBAC.DAL.Entities;

namespace RBAC.DAL.Mappers
{
	public class UserMap : ClassMap<User>
    {
		public UserMap()
		{
			Id(x => x.Id);
							
													Map(x => x.Username).Not.Nullable()						.Length(255)						.UniqueKey("UQ_User_Username");			
					
													Map(x => x.Password).Not.Nullable()						.Length(255)						;			
					
													Map(x => x.Email).Not.Nullable()						.Length(255)						;			
					
													Map(x => x.Mobile).Not.Nullable()						.Length(255)						;			
					
													Map(x => x.CreateDate).Not.Nullable()												;			
					
													References(x => x.Role).Cascade.All();
					
													Map(x => x.UserStatus).Not.Nullable()												;			
					
					}

	}
}